package com.pmcc.cj.repository;

import com.pmcc.cj.entity.CjCommodityYun;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by tomas on 2020/9/22.
 */
public interface CjCommodityYunRepository extends JpaRepository<CjCommodityYun,String> {
    Page<CjCommodityYun> findAll(Specification<CjCommodityYun> spec, Pageable var1);

    List<CjCommodityYun> findByProductIdAndTypeIdAndFettle(String productName,String typeName,Integer fettle);
    CjCommodityYun findById(String id);
    @Modifying
    @Query(value ="select id,name from cj_commodity_yun where product_id=?1 ",  nativeQuery = true)
    List queryCountryCombo(String dictId);
}
